import Vue from "vue";
import VueRouter from "vue-router";
import Login from "@/views/Login.vue";
import Register from "@/views/Register.vue";
import Layout from "@/views/Layout.vue";
import Article from "@/views/Article.vue";
import Collect from "@/views/Collect.vue";
import Like from "@/views/Like.vue";
import User from "@/views/User.vue";
import Recommend from "@/views/HmRecommend.vue";
import HmNew from "@/views/HmNew.vue";
import Detail from "@/views/Detail.vue";
Vue.use(VueRouter);
const router = new VueRouter({
  linkActiveClass: "active",
  routes: [
    { path: "/", redirect: "/login" },
    { path: "/login", component: Login },
    { path: "/register", component: Register },
    {
      path: "/layout",
      component: Layout,
      children: [
        {
          path: "/layout/article",
          component: Article,
          children: [
            { path: "/layout/article/recommend", component: Recommend },
            { path: "/layout/article/new", component: HmNew },
          ],
        },
        { path: "/layout/collect", component: Collect },
        { path: "/layout/like", component: Like },
        { path: "/layout/user", component: User },
      ],
    },
    { path: "/detail/:id", component: Detail },
    // {path:'/login',component:Login},
    // { path: "*", component: Login },
  ],
});
export default router;
